<?php 
require_once 'include.php';
$cates=getAllcate();
?>

<link type="text/css" rel="stylesheet" href="styles/reset.css">
<link type="text/css" rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/mF_fancy.css">
	<script src="js/addFavorite.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript" src="js/ie6Fixpng.js"></script>
<![endif]-->

<div class="headerBar">
	<div class="topBar">
		<div class="comWidth">
			<div class="leftArea">
				<a href="#" onclick="AddFavorite(window.location,document.title)" class="collection" >收藏网站</a>
			</div>
			<div class="rightArea">
				欢迎来到松田淘淘乐！
				<?php if($_SESSION['loginFlag']):?>
				<span><a href="userHome.php"><?php echo $_SESSION['username'];?></a>
				<a href="doAction.php?act=userOut">[退出]</a>
				<?php else:?>
				<a href="login.php">[登录]</a><a href="reg.php">[免费注册]</a>
				<?php endif;?>
			</div>
		</div>
	</div>
	<div class="logoBar">
		<div class="comWidth">
			<div class="logo fl">
				<a href="index.php"><img src="images/logo_index.png" alt="松田淘淘乐"></a>
			</div>
			<div class="search_box fl">
				<input type="text" class="search_text fl" id="keywords">
				<a href="javascript:search()"><input type="button" value="搜 索" class="search_btn fr"></a>
			</div>
			<script>
			function search(){
				keywords=document.getElementById('keywords').value;
				window.location='search.php?keywords='+keywords;
			}
			</script>
			<div class="shopCar fr">
				<a href="cart.php" style="color:#FFF"><span class="shopText fl" >购物车</span>
				<span class="shopNum fl"><?php echo getAllCartProNum();?></span></a>
			</div>
		</div>
	</div>
	<div class="navBox">
		<div class="comWidth clearfix">
			<div class="shopClass fl">
				<a href="classify.php" style="color:#FFF"><h3>全部商品分类<i class="shopClass_icon"></i></h3></a>
				
			</div>
			<ul class="nav fl">
				<?php foreach($cates as $cate):?>
				<li><a href="classify.php?cateid=<?php echo $cate['id'];?>&cname=<?php echo $cate['cName'];?>"><?php echo $cate['cName'];?></a></li>
				<?php endforeach;?>
				<li><a href="about.php">关于我们</a></li>
			</ul>
		</div>
	</div>
</div>
